
// var a=document.querySelector('table').classList
// var b=Array.from(a)
// // console.log(b)
// // console.log(b.includes('table-hover1'))

var tbody=document.querySelector('tbody')
// // console.log(tbody)

var info2=document.querySelector('#info2')

on(tbody,'click',(e)=>{
//获取th标签
// console.log(e.target)
// console.log(e.target.classList.contains)
if(e.target.classList.contains('btn-del')){

var id= e.target.parentNode.parentNode.getAttribute('data-id')
// console.log(id)
utils.fetch('./api/v1/shop/del.php',{id}).then(resp=>{
    info2.innerHTML=resp.body.msg
    if(resp.code===200){
        info2.classList.add('text-succeed')
        setTimeout(()=>{
            info2.innerHTML=""
            info2.className=''
            getdata()
        },1000)

    }else{
        info2.classList.add('text-danger')
        setTimeout(()=>{
            info2.innerHTML=""
            info2.className=''
            getdata()
        },1000)

    }
    
    
    })

}
})




